<?php
/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * User Application, Logout Module (Frontend)
 * Started: 6 September 2009 20:17 PM (Last one for the day, and I'm commiting)
 * Script version: 1.0
 +------------------------------------
 */

class module implements module_interface{
	public function returninitvars(){
		global $lang;
		$this->info["page_title"] = $lang->getByKey("user.profile.title");
		$this->info["page_description"] = "";
		$this->info["module_version"] = "1.0";
		return $this->info;
	}

	public function construct(){
		global $_CF;
		$this->run = (isset($_GET['uid']) ? true : false);
		if(!$this->run){
			$_CF->view->writeIn($_CF->view->inlineError($_CF->lang->getByKey("user.profile.noid")));
			$this->custom_error = true; # Turn off module error handler
		}
		else{
			$this->id = intval($_GET['uid']);
			$this->controller = new user($this->id);
		}
	}
	
	public function run(){
		global $_CF;
		$this->data = array_merge($this->controller->user, $this->controller->groupArray);
		$this->parts['centerbox1'] = $_CF->view->showTemplate("profile_centerbox", $this->data);
		$this->parts['stats'] = $_CF->view->tablePadded($_CF->lang->getByKey("user.profile.stats"),
														$_CF->view->showTemplate("profile_stats", $this->data),
														"time");
		$this->parts['lastvisitors'] = $_CF->view->tablePadded($_CF->lang->getByKey("user.profile.lv"),
															   $_CF->view->showTemplate("profile_lastvisitors", $this->data),
															   "user");
										
		$_CF->view->writeIn($_CF->view->showTemplate("profile", $this->parts));
	}

	public function destruct(){}
}
